home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / PInterfaces / QD3DSet.p < prev    next >
Encoding:
Text File  |  1997-08-12  |  11.4 KB  |  312 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        QD3DSet.p
  3.  
  4.      Contains:    Q3Set types and routines                                            
  5.  
  6.      Version:    Technology:    Quickdraw 3D 1.5.1
  7.                  Release:    Universal Interfaces 3.0.1
  8.  
  9.      Copyright:    © 1995-1997 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT QD3DSet;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __QD3DSET__}
  28. {$SETC __QD3DSET__ := 1}
  29.  
  30. {$I+}
  31. {$SETC QD3DSetIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __QD3D__}
  35. {$I QD3D.p}
  36. {$ENDC}
  37.  
  38.  
  39. {$PUSH}
  40. {$ALIGN POWER}
  41. {$LibExport+}
  42.  
  43. {*****************************************************************************
  44.  **                                                                             **
  45.  **                                Set Routines                                 **
  46.  **                                                                             **
  47.  ****************************************************************************}
  48. FUNCTION Q3Set_New: TQ3SetObject; C;
  49. FUNCTION Q3Set_GetType(theSet: TQ3SetObject): LONGINT; C;
  50. FUNCTION Q3Set_Add(theSet: TQ3SetObject; theType: TQ3ElementType; data: UNIV Ptr): TQ3Status; C;
  51. FUNCTION Q3Set_Get(theSet: TQ3SetObject; theType: TQ3ElementType; data: UNIV Ptr): TQ3Status; C;
  52. FUNCTION Q3Set_Contains(theSet: TQ3SetObject; theType: TQ3ElementType): TQ3Boolean; C;
  53. FUNCTION Q3Set_Clear(theSet: TQ3SetObject; theType: TQ3ElementType): TQ3Status; C;
  54. FUNCTION Q3Set_Empty(target: TQ3SetObject): TQ3Status; C;
  55. {
  56.  *  Iterating through all elements in a set
  57.  *
  58.  *  Pass in kQ3ElementTypeNone to get first type
  59.  *  kQ3ElementTypeNone is returned when end of list is reached
  60.  }
  61. FUNCTION Q3Set_GetNextElementType(theSet: TQ3SetObject; VAR theType: TQ3ElementType): TQ3Status; C;
  62.  
  63. {*****************************************************************************
  64.  **                                                                             **
  65.  **                                Attribute Types                                 **
  66.  **                                                                             **
  67.  ****************************************************************************}
  68.  *    For the data types listed below, pass in a pointer to it in the _Add 
  69.  *    and _Get calls.
  70.  *
  71.  *    For surface shader attributes, reference counts are incremented on 
  72.  *    the _Add and _Get 
  73.  }
  74.  
  75. TYPE
  76.     TQ3AttributeTypes             = LONGINT;
  77. CONST
  78.                                                                 {  Data Type                 }
  79.     kQ3AttributeTypeNone        = {TQ3AttributeTypes}0;            {  ---------                 }
  80.     kQ3AttributeTypeSurfaceUV    = {TQ3AttributeTypes}1;            {  TQ3Param2D                 }
  81.     kQ3AttributeTypeShadingUV    = {TQ3AttributeTypes}2;            {  TQ3Param2D                  }
  82.     kQ3AttributeTypeNormal        = {TQ3AttributeTypes}3;            {  TQ3Vector3D                  }
  83.     kQ3AttributeTypeAmbientCoefficient = {TQ3AttributeTypes}4;    {  float                      }
  84.     kQ3AttributeTypeDiffuseColor = {TQ3AttributeTypes}5;        {  TQ3ColorRGB                 }
  85.     kQ3AttributeTypeSpecularColor = {TQ3AttributeTypes}6;        {  TQ3ColorRGB                 }
  86.     kQ3AttributeTypeSpecularControl = {TQ3AttributeTypes}7;        {  float                     }
  87.     kQ3AttributeTypeTransparencyColor = {TQ3AttributeTypes}8;    {  TQ3ColorRGB                 }
  88.     kQ3AttributeTypeSurfaceTangent = {TQ3AttributeTypes}9;        {  TQ3Tangent2D               }
  89.     kQ3AttributeTypeHighlightState = {TQ3AttributeTypes}10;        {  TQ3Switch                  }
  90.     kQ3AttributeTypeSurfaceShader = {TQ3AttributeTypes}11;        {  TQ3SurfaceShaderObject     }
  91.     kQ3AttributeTypeNumTypes    = {TQ3AttributeTypes}12;
  92.  
  93.  
  94. TYPE
  95.     TQ3AttributeType                    = TQ3ElementType;
  96. {*****************************************************************************
  97.  **                                                                             **
  98.  **                                Attribute Drawing                             **
  99.  **                                                                             **
  100.  ****************************************************************************}
  101. FUNCTION Q3Attribute_Submit(attributeType: TQ3AttributeType; data: UNIV Ptr; view: TQ3ViewObject): TQ3Status; C;
  102.  
  103. {*****************************************************************************
  104.  **                                                                             **
  105.  **                            AttributeSet Routines                             **
  106.  **                                                                             **
  107.  ****************************************************************************}
  108. FUNCTION Q3AttributeSet_New: TQ3AttributeSet; C;
  109. FUNCTION Q3AttributeSet_Add(attributeSet: TQ3AttributeSet; theType: TQ3AttributeType; data: UNIV Ptr): TQ3Status; C;
  110. FUNCTION Q3AttributeSet_Contains(attributeSet: TQ3AttributeSet; attributeType: TQ3AttributeType): TQ3Boolean; C;
  111. FUNCTION Q3AttributeSet_Get(attributeSet: TQ3AttributeSet; theType: TQ3AttributeType; data: UNIV Ptr): TQ3Status; C;
  112. FUNCTION Q3AttributeSet_Clear(attributeSet: TQ3AttributeSet; theType: TQ3AttributeType): TQ3Status; C;
  113. FUNCTION Q3AttributeSet_Empty(target: TQ3AttributeSet): TQ3Status; C;
  114. {
  115.  * Q3AttributeSet_GetNextAttributeType
  116.  *
  117.  * Pass in kQ3AttributeTypeNone to get first type
  118.  * kQ3AttributeTypeNone is returned when end of list is reached
  119.  }
  120. FUNCTION Q3AttributeSet_GetNextAttributeType(source: TQ3AttributeSet; VAR theType: TQ3AttributeType): TQ3Status; C;
  121. FUNCTION Q3AttributeSet_Submit(attributeSet: TQ3AttributeSet; view: TQ3ViewObject): TQ3Status; C;
  122. {
  123.  * Inherit from parent->child into result
  124.  *    Result attributes are:
  125.  *        all child attributes + all parent attributes NOT in the child
  126.  }
  127. FUNCTION Q3AttributeSet_Inherit(parent: TQ3AttributeSet; child: TQ3AttributeSet; result: TQ3AttributeSet): TQ3Status; C;
  128.  
  129. {*****************************************************************************
  130.  **                                                                             **
  131.  **                            Custom Element Registration                         **
  132.  **                                                                             **
  133.  ****************************************************************************}
  134. {
  135.  * Element Methods - 
  136.  *
  137.  *         When you create a custom element, you control what structures are 
  138.  *        passed around the API. For example, you may allow the Q3Set_Add call 
  139.  *        take one type of argument, store your element internally in some 
  140.  *        abstract data type, and have the Q3Set_Get call take a different 
  141.  *        argument.
  142.  *
  143.  *        For example:
  144.  *            
  145.  *        There are four calls which at some point will copy an element:
  146.  *
  147.  *        Q3Set_Add (copied from Application memory to QuickDraw3D memory)
  148.  *        Q3Set_Get (copied from QuickDraw3D memory to Application memory)
  149.  *        Q3Object_Duplicate (all elements are copied internally)
  150.  *        Q3AttributeSet_Inherit (all elements are copied internally)
  151.  *
  152.  *         Either CopyAdd or CopyReplace is called during the "_Add" call.
  153.  *            - CopyAdd is destructive and should assume "toElement" is garbage
  154.  *            - CopyReplace is replacing an existing element.
  155.  *
  156.  *         CopyGet is called during the "_Get" call.
  157.  *
  158.  *         CopyDuplicate is called to duplicate an element's internal structure.
  159.  *
  160.  * Attributes Methods - 
  161.  *
  162.  *        For copying data while Inheriting. Element methods are used
  163.  *        at all other times.
  164.  *    
  165.  *         CopyInherit is called to duplicate an element's internal structure 
  166.  *            during inheritance. You should make this as fast as possible.
  167.  *            (for example, if your custom element contains objects, you
  168.  *             should do a Q3Shared_GetReference instead of a Q3Object_Duplicate)
  169.  *            
  170.  *        The ElementDelete method will be called for all of your elements copied 
  171.  *        around via CopyAdd, CopyReplace, CopyDuplicate, and CopyInherit.
  172.  *        If CopyGet allocates any memory in it's destination, it is up to the app 
  173.  *        to delete it on its side.
  174.  }
  175.  
  176. TYPE
  177.     TQ3ElementCopyAddMethod = ProcPtr;  { FUNCTION TQ3ElementCopyAddMethod(fromAPIElement: UNIV Ptr; toInternalElement: UNIV Ptr): TQ3Status; C; }
  178.  
  179.     TQ3ElementCopyReplaceMethod = ProcPtr;  { FUNCTION TQ3ElementCopyReplaceMethod(fromAPIElement: UNIV Ptr; ontoInternalElement: UNIV Ptr): TQ3Status; C; }
  180.  
  181.     TQ3ElementCopyGetMethod = ProcPtr;  { FUNCTION TQ3ElementCopyGetMethod(fromInternalElement: UNIV Ptr; toAPIElement: UNIV Ptr): TQ3Status; C; }
  182.  
  183.     TQ3ElementCopyDuplicateMethod = ProcPtr;  { FUNCTION TQ3ElementCopyDuplicateMethod(fromInternalElement: UNIV Ptr; toInternalElement: UNIV Ptr): TQ3Status; C; }
  184.  
  185.     TQ3ElementDeleteMethod = ProcPtr;  { FUNCTION TQ3ElementDeleteMethod(internalElement: UNIV Ptr): TQ3Status; C; }
  186.  
  187. FUNCTION Q3ElementClass_Register(elementType: TQ3ElementType; name: ConstCStringPtr; sizeOfElement: LONGINT; metaHandler: TQ3MetaHandler): TQ3ObjectClass; C;
  188. FUNCTION Q3ElementType_GetElementSize(elementType: TQ3ElementType; VAR sizeOfElement: LONGINT): TQ3Status; C;
  189.  
  190. {*****************************************************************************
  191.  **                                                                             **
  192.  **                        Custom Attribute Registration                         **
  193.  **                                                                             **
  194.  ****************************************************************************}
  195.  
  196. TYPE
  197.     TQ3AttributeInheritMethod            = TQ3Boolean;
  198. { return kQ3True or kQ3False in your metahandler }
  199.     TQ3AttributeCopyInheritMethod = ProcPtr;  { FUNCTION TQ3AttributeCopyInheritMethod(fromInternalAttribute: UNIV Ptr; toInternalAttribute: UNIV Ptr): TQ3Status; C; }
  200.  
  201. FUNCTION Q3AttributeClass_Register(attributeType: TQ3AttributeType; creatorName: ConstCStringPtr; sizeOfElement: LONGINT; metaHandler: TQ3MetaHandler): TQ3ObjectClass; C;
  202. {
  203.  *    Version 1.1
  204.  }
  205.  
  206. TYPE
  207.     TQ3AttributeDefaultMethod = ProcPtr;  { FUNCTION TQ3AttributeDefaultMethod(internalElement: UNIV Ptr): TQ3Status; C; }
  208.  
  209.     TQ3AttributeIsDefaultMethod = ProcPtr;  { FUNCTION TQ3AttributeIsDefaultMethod(internalElement: UNIV Ptr): TQ3Boolean; C; }
  210.  
  211.  
  212.  
  213. CONST
  214.     kQ3XMethodTypeElementCopyAdd = 'ecpa';
  215.  
  216.  
  217. TYPE
  218.     TQ3XElementCopyAddMethod = ProcPtr;  { FUNCTION TQ3XElementCopyAddMethod(fromAPIElement: UNIV Ptr; toInternalElement: UNIV Ptr): TQ3Status; C; }
  219.  
  220.  
  221. CONST
  222.     kQ3XMethodTypeElementCopyReplace = 'ecpr';
  223.  
  224.  
  225. TYPE
  226.     TQ3XElementCopyReplaceMethod = ProcPtr;  { FUNCTION TQ3XElementCopyReplaceMethod(fromAPIElement: UNIV Ptr; ontoInternalElement: UNIV Ptr): TQ3Status; C; }
  227.  
  228.  
  229. CONST
  230.     kQ3XMethodTypeElementCopyGet = 'ecpg';
  231.  
  232.  
  233. TYPE
  234.     TQ3XElementCopyGetMethod = ProcPtr;  { FUNCTION TQ3XElementCopyGetMethod(fromInternalElement: UNIV Ptr; toAPIElement: UNIV Ptr): TQ3Status; C; }
  235.  
  236.  
  237. CONST
  238.     kQ3XMethodTypeElementCopyDuplicate = 'ecpd';
  239.  
  240.  
  241. TYPE
  242.     TQ3XElementCopyDuplicateMethod = ProcPtr;  { FUNCTION TQ3XElementCopyDuplicateMethod(fromInternalElement: UNIV Ptr; toInternalElement: UNIV Ptr): TQ3Status; C; }
  243.  
  244.  
  245. CONST
  246.     kQ3XMethodTypeElementDelete    = 'edel';
  247.  
  248.  
  249. TYPE
  250.     TQ3XElementDeleteMethod = ProcPtr;  { FUNCTION TQ3XElementDeleteMethod(internalElement: UNIV Ptr): TQ3Status; C; }
  251.  
  252. FUNCTION Q3XElementClass_Register(VAR elementType: TQ3ElementType; name: ConstCStringPtr; sizeOfElement: LONGINT; metaHandler: TQ3XMetaHandler): TQ3XObjectClass; C;
  253. FUNCTION Q3XElementType_GetElementSize(elementType: TQ3ElementType; VAR sizeOfElement: LONGINT): TQ3Status; C;
  254.  
  255. {*****************************************************************************
  256.  **                                                                             **
  257.  **                        Custom Attribute Registration                         **
  258.  **                                                                             **
  259.  ****************************************************************************}
  260.  
  261. CONST
  262.     kQ3XMethodTypeAttributeInherit = 'inht';
  263.  
  264.  
  265. TYPE
  266.     TQ3XAttributeInheritMethod            = TQ3Boolean;
  267. { return kQ3True or kQ3False in your metahandler }
  268.  
  269. CONST
  270.     kQ3XMethodTypeAttributeCopyInherit = 'acpi';
  271.  
  272.  
  273. TYPE
  274.     TQ3XAttributeCopyInheritMethod = ProcPtr;  { FUNCTION TQ3XAttributeCopyInheritMethod(fromInternalAttribute: UNIV Ptr; toInternalAttribute: UNIV Ptr): TQ3Status; C; }
  275.  
  276. FUNCTION Q3XAttributeClass_Register(VAR attributeType: TQ3AttributeType; creatorName: ConstCStringPtr; sizeOfElement: LONGINT; metaHandler: TQ3XMetaHandler): TQ3XObjectClass; C;
  277. {
  278.  *    Version 1.1
  279.  }
  280.  
  281. CONST
  282.     kQ3XMethodTypeAttributeDefault = 'asdf';
  283.  
  284.  
  285. TYPE
  286.     TQ3XAttributeDefaultMethod = ProcPtr;  { FUNCTION TQ3XAttributeDefaultMethod(internalElement: UNIV Ptr): TQ3Status; C; }
  287.  
  288.  
  289. CONST
  290.     kQ3XMethodTypeAttributeIsDefault = 'aidf';
  291.  
  292.  
  293. TYPE
  294.     TQ3XAttributeIsDefaultMethod = ProcPtr;  { FUNCTION TQ3XAttributeIsDefaultMethod(internalElement: UNIV Ptr): TQ3Boolean; C; }
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301. {$ALIGN RESET}
  302. {$POP}
  303.  
  304. {$SETC UsingIncludes := QD3DSetIncludes}
  305.  
  306. {$ENDC} {__QD3DSET__}
  307.  
  308. {$IFC NOT UsingIncludes}
  309.  END.
  310. {$ENDC}
  311.